﻿<div class="well with-header" ng-controller="WithdrawController">
    <div class="header bg-themeprimary">
        Withdraw
        <div class="btn-group pull-right">
            <span class="btn btn-sm" style="margin-right:10px;" ng-click="popup('','FormWithdraw','WithdrawModalInstanceCtrl','sm')"><i class="fa fa-plus"></i> Withdraw</span>
        </div>
    </div>
    <div class="widget-body">
        <div class="widget-main ">
            <div class="row">
                <div class="col-sm-12">
                    <table class="table table-bordered table-striped table-condensed flip-content">
                        <thead class="flip-content bordered-palegreen">
                            <tr>
                                <th width="1%">#</th>
                                <th>CreateDate</th>
                                <th width="10%">Status</th>
                                <th>Value</th>
                                <th>PH User</th>
                                <th>PH Name</th>
                                <th>Remaining</th>
                                <th>Type</th>
                                <th>Action</th>
                            </tr>
                        </thead>
                        <tbody ng-repeat="data in List" ng-show="List.length != 0" style="border:1px solid #ccc !important;">
                            <tr ng-style="data.Status === 0 && {'background-color':'white'} ||data.Status == 1 && {'background-color':'#9DFFB0'} ||data.Status == 2 && {'background-color':'9DFFB0'} || data.Status == 3 && {'background-color':'#9DFFB0'}">
                                <td class=" numeric">
                                    {{$index+1}}
                                </td>
                                <td class="numeric">{{data.CreateDate}}</td>
                                <td>{{data.StatusName}}</td>
                                <td>{{data.Amount | number}}</td>
                                <td></td>
                                <td></td>
                                <td>{{data.Remaining}}</td>
                                <td>{{data.TypeName}}</td>
                                <td></td>
                            </tr>
                            <tr ng-repeat="item in data.TransferOrder" ng-show="item.TransferOrder.length != 0" ng-style="item.Status == 2 && {'background-color':'#c4ffcf'}">
                                <td class="numeric"></td>
                                <td>{{item.CreateDate | amUtc | amDateFormat:'DD/MM/YYYY HH:mm:ss A'}}</td>
                                <td>
                                    <span ng-if="item.Status == 0 && item.ShowConfirm == false">Proccesing</span>
                                    <span ng-if="item.Status == 0 && item.ShowConfirm == true">Confirmed</span>
                                    <span ng-if="item.Status == 1">Bad</span>
                                    <span ng-if="item.Status == 2">Complete</span>
                                </td>
                                <td>{{item.Amount | number}}</td>
                                <td>{{item.PH_Name}}</td>
                                <td>{{item.PH_Mobile}}</td>
                                <td>{{item.Remaining}}</td>
                                <td></td>
                                <td>
                                    <a href="#" class="at-view" ng-click="popup('','FormPHViewModal','PHViewModalInstanceCtrl','lg',{{item.UserPH}},{{item.Id}})">View</a>
                                    <a href="#" class="at-confirm" ng-if="item.ShowConfirm == true && item.Status != 2" ng-click="doConfirm(item.Id)" confirm="Are you sure confirm this ?">Confirm</a>
                                    <a href="#" class="at-bad" ng-if="item.Remaining=='0' && item.Status != 2" ng-click="popup('','FormBadReportPHModal','ReportPHModalInstanceCtrl','lg',{{item.Id}},'')"> Report</a>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    <!--<div class="pull-right">
                        <ul uib-pagination total-items="totalItems" ng-model="currentPage" max-size="maxSize" class="pagination-sm" boundary-link-numbers="true" items-per-page="itemsPerPage"></ul>
                    </div>-->
                </div>
            </div>
        </div>
    </div>
    <!--- View GH --->
    <script type="text/ng-template" id="FormPHViewModal">
        <div class="modal-header">
            <strong>PH User Information</strong>
            <button type="button" class="close" data-dismiss="modal" aria-label="Close" ng-click="cancel()"><span aria-hidden="true">&times;</span></button>
        </div>
        <div class="modal-body">
            <p class="text-danger">{{messeger}}</p>
            <span id="noticePH"></span>
            <div class="row">
                <div class="col-md-6">
                    <div class="form-group">
                        <label style="width:30%;font-weight:bold;text-align:right;">PH User :</label>
                        <label>{{user.UserName}}</label>
                    </div>
                    <div class="form-group">
                        <label style="width:30%;font-weight:bold;text-align:right;">PH Full Name :</label>
                        <label>{{user.HoTen}}</label>
                    </div>
                    <div class="form-group">
                        <label style="width:30%;font-weight:bold;text-align:right;">PH Mobile :</label>
                        <label>{{user.SDTNHARIENG}}</label>
                    </div>
                    <div class="form-group">
                        <label style="width:30%;font-weight:bold;text-align:right;">PH Bank Number :</label>
                        <label>{{user.SoTaiKhoan}}</label>
                    </div>
                    <div class="form-group">
                        <label style="width:30%;font-weight:bold;text-align:right;">PH Bank Name :</label>
                        <label>{{user.BankName}}</label>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                        <label style="width:30%;font-weight:bold;text-align:right;">Upline User :</label>
                        <label>{{parent.UserName}}</label>
                    </div>
                    <div class="form-group">
                        <label style="width:30%;font-weight:bold;text-align:right;">Upline Full Name :</label>
                        <label>{{parent.HOTEN}}</label>
                    </div>
                    <div class="form-group">
                        <label style="width:30%;font-weight:bold;text-align:right;">Upline Mobile :</label>
                        <label>{{parent.SDTNHARIENG}}</label>
                    </div>
                </div>
                <br style="clear:both" />
                <p style="width:100%; font-size:15px; text-indent:2%;background-color:#F5F5F5;line-height:30px; font-weight:bold;"> Notification from PH</p>
                <div class="col-md-6">
                    <img src="{{imagePH}}" class="img-responsive" style="max-width:850px !important;vertical-align:middle;text-align:left;" />
                </div>
            </div>
        </div>
        <div class="modal-footer">
            <button class="btn btn-default" ng-click="cancel()" data-dismiss="modal">Close</button>
        </div>
    </script>
    <!---/View GH --->
    <!---Withdraw -->
    <script type="text/ng-template" id="FormWithdraw">
        <div class="modal-header">
            <strong>Withdraw</strong>
        </div>
        <div class="modal-body">
            <div class="loginbox">
                <p class="text-danger">{{messeger}}</p>
                <form name="simpleForm" method="post" class="bv-form" novalidate="novalidate">
                    <div class="form-group">
                        <label>Profit wallet :</label>
                        $<b> {{profit|number}}</b>
                    </div>
                    <div class="form-group">
                        <label>Amount :</label>
                        $<b> 1,500,000</b>
                    </div>
                </form>
            </div>
        </div>
        <div class="modal-footer">
            <span ng-if="processing" class="text-success"><i class="fa fa-circle-o-notch fa-spin"></i></span>
            <button type="button" class="btn btn-success" ng-click="doWithdraw()" ng-disabled="processing">Submit</button>
            <button type="button" class="btn btn-default" ng-click="cancel()">Cancel</button>
        </div>
    </script>
    <!---/Withdraw-->
</div>

